import { defineComponent } from 'vue';
import './index.scss';

export default defineComponent({
  name: 'LinkColumn',
  props: {
    cellParam: Object,
    record: Object,
    column: Object,
    rowIndex: Number,
  },
  emits: ['columnLinkFormat'],
  setup(props, { attrs, emit, expose, slots }) {
    const onHandlerClick = () => {
      emit('columnLinkFormat');
    };

    return () => {
      return (
        <span class={'linkColum'}>
          <a title={props.cellParam?.value} class={['text-primary', 'cellLinkHref']} onClick={onHandlerClick}>
            {props.cellParam?.value}
          </a>
        </span>
      );
    };
  },
});
